package com.fancy.learncenter.view;

import android.app.Activity;
import android.graphics.drawable.BitmapDrawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.superservice.lya.R;


/**
 * LeeBoo
 */

public class PopupWindowYgt extends BasedPopupWindow {

    private View popuView;
    private View locationView;
    private View.OnClickListener listener;


    public PopupWindowYgt(Activity mContext, View viewGroup) {
        super(mContext);
        popuView = LayoutInflater.from(mContext).inflate(R.layout.activity_ygt_payi, (ViewGroup) viewGroup, false);
        this.locationView = viewGroup;
        initPopuWindow();
    }

    private void initPopuWindow() {
        setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
        setOutsideTouchable(true);
        setBackgroundDrawable(new BitmapDrawable());
        update();
        setContentView(popuView);
        popuView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

    @Override
    public void showPopupWindow() {
        super.showPopupWindow();
        showAtLocation(locationView, Gravity.BOTTOM, 0, 0);
    }
}
